#ifndef CLOCK_H
#define CLOCK_H

#include <QMainWindow>
#include <QWidget>
#include <QLCDNumber>
#include <QPushButton>
#include <QTextEdit>
#include <QMessageBox>
#include <QTextToSpeech>
#include <QPainter>
#include"childwindow.h"
QT_BEGIN_NAMESPACE
namespace Ui {
class clock;
}
QT_END_NAMESPACE

class clock : public QMainWindow
{
    Q_OBJECT
signals:
    void signal_1();//闹钟设置完成发射一个完成信号

public Q_SLOTS:
    void on_setting_btn_clicked();//设置闹钟
    void on_start_btn_clicked();//启用闹钟
    void on_stop_btn_clicked();//关闭闹钟
public:
    clock(QMainWindow *parent = nullptr);
    ~clock();
    void paintEvent(QPaintEvent *event);

    void timerEvent(QTimerEvent *);
    void mousePressEvent(QMouseEvent *e);
    void mouseMoveEvent(QMouseEvent *e);
private slots:
    void on_pushButton_clicked();
    void childwindow_close();

    void on_pushButton_shuoming_clicked();

private:
    Ui::clock *ui;
    QLCDNumber* text_LCD;//显示时间
    QTextEdit* text_edit;//备忘录
    QPushButton* setting_btn;//设置闹钟按钮
    QPushButton* start_btn;//启用闹钟按钮
    QPushButton* stop_btn;//关闭闹钟按钮
    QPushButton* pushButton;

    QTextToSpeech speech;//语音播报
    bool showflag;//秒 ：是否显示
    QPoint movePoint;//起始位置
    QString set_time;//设置闹钟事件
    int timer_id;//定时器编号
    int hour = 0, min = 0;//闹钟时间 时、分
    int time_setting = 0; //启用设置时间
    bool say_flag;//是否播报
    childWindow *childwindow_ui=nullptr;
};
#endif // CLOCK_H